/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.edu.upc.sad.controller;
import java.util.ArrayList;
import java.util.List;
import pe.edu.upc.sad.service.UsuarioService;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import pe.edu.upc.sad.model.Usuario;

/**
 *
 * @author HP
 */
@Controller
public class ListarUsuario {

     private UsuarioService usuarioService;

	@RequestMapping(value="getStates.json", method = RequestMethod.GET)
	public @ResponseBody Map<String,? extends Object> loadStates() {

		HashMap<String, List<Usuario>> modelMap = new HashMap<String,List<Usuario>>();
		modelMap.put("states", usuarioService.getUsuariosAll());

		return modelMap;
	}

	@Autowired
	public void setStateService(UsuarioService usuarioService) {
		this.usuarioService = usuarioService;
	}

      
}
